package com.wuliang.blog.response;

import java.io.Serializable;

/**
 * 枚举类
 * 用来定义各个服务的接口中返回给客户端的状态
 *
 * @author huminghao
 */
public enum ReturnCode implements Serializable {
    //    操作错误
    ERROR(500, "操作错误"),
    //    验证码错误
    ERROR_VERIFICATION_CODE(510, "验证码错误"),
    //    操作成功
    SUCCESS(200, "操作成功"),
    //
    NO_JWT_TOKEN(4034, "通行令牌为空，您尚未登录"),
    //    凭据错误
    BAD_CREDENTIAL(420, "凭据错误"),
    //    无权限访问
    ACCESS_DENIED(423, "无权限访问"),
    //    未查询到该用户
    USER_NOT_FOUND(424, "未查询到该用户"),
    NAME_OR_PASSWORD_ERROR(425, "用户名或密码错误"),
    //    用户账户状态异常
    ACCOUNT_STATUS(430, "用户账户状态异常"),
    //    账户过期
    ACCOUNT_EXPIRED(431, "账户过期"),
    //    账户锁定
    USER_LOCKED(432, "账户锁定"),
    //    账户不可用
    USER_DISABLED(433, "账户不可用"),
    //    证书过期
    CREDENTIALS_EXPIRED(434, "证书过期"),
    CREDENTIALS_REAL_EXPIRED(435, "证书过期，请重新登录"),
    NONCE_EXPIRED(),
    AUTHENTICATION_SERVICE(),
    PROVIDER_NOT_FOUND(),
    SESSION_AUTHENTICATION(),
    INSUFFICIENT_AUTHENTICATION(),
    //    系统异常
    SYSTEM_EXCEPTION(500, "系统异常"),
    //    未查询到指定店铺
    SHOP_NOT_FOUND(510, "未查询到指定店铺"),
    EXCUTE_SERVICE_ERROR(600, "服务间调用失败"),
    HAVE_USER_USE(301, "尚有使用该角色的用户，不能删除！"),
    HAVE_POWER_USE(302, "该权限存在下属权限，无法删除！"),
    POWER_LOGICNAME_REPEAT(303, "权限英文名重复，无法新增！"), SERIAL_NUMBER_REPEAT(304, "序列号已存在!"),
    SERIAL_NUMBER_REQUIRED(305, "序列号必填!"),
    ID_REQUIRED(306, "没有主键ID,无法修改!"),
    HAS_SUBPOWERS(307, "该权限存在下属权限，无法删除！"),
    NOT_HAVE_POWERCODE(308, "数据中没有权限编码，无法删除！"),
    POWER_LOGICNAME_REQUEIRD(309, "权限英文名必填！"),
    ROLE_NAME_REPEAT(310, "角色名称已经存在！"),
    ROLE_NAME_REQUIRED(311, "角色名称必填！"),
    PASSWORD_REQUEIRD(312, "密码必填！"),
    USERNAME_REPEAT(313, "用户名称重复！"),
    FILEPATH_NOT_FOUND(314, "文件路径或文件不存在！"),
    FILEVERSION_ERROR(315, "该版本下没有程序文件！"),
    AGREEMENTTITLE_REPEAT(316, "协议标题重复！"),
    HOST_NOT_CONNECT_NETWORK(317, "主机未联网！"),
    THEME_ORDER_REPEAT(318, "该主题已经在该地区销售过了！"),
    FILE_TYPE_ERROR(319, "文件格式错误！"),
    FILE_SIZE_OVERFLOW(320, "文件过大！"),

    PHONE_FORMAT_ERROR(5003, "手机号格式错误"),
    DATA_IS_EMPTY(402, "查询结果为空"),
    PARAM_ERROR(401, "参数错误"),
    PARAM_NOT_FOUND(400, "参数缺失"),

    CHECK_PHONE_MESSAGE(601, "请先进行短信验证"),

    REPEAT_DATA(5002, "数据重复，请勿重复添加数据"),

    REPEAT_SUBMIT(5003, "请勿重复提交"),
    DATA_STATE_ERROR(5004, "数据状态异常"),

    PARAM_CHECK_FAIL(4005, "参数错误");

    private Integer code;

    private String message;

    ReturnCode() {
    }

    ReturnCode(Integer code, String message) {
        this.message = message;
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public Integer getCode() {
        return code;
    }

}
